/*
for (const key in document.styleSheets) {
    if (document.styleSheets.hasOwnProperty(key)) {
        const element = document.styleSheets[key];
        try{
        for (const c in element.cssRules) {
            
            if (element.cssRules.hasOwnProperty(c)) {
                const rule = element.cssRules[c];
                (window.cssList || (window.cssList = [])).push({ selectorText: rule.selectorText, cssText: rule.cssText });
            }
        }
        }catch{}
    }
}; 
window.cssList
.filter(x=>x.cssText)
.filter(x=>(document.querySelector(x.selectorText)?.style.display??'none')!='none')
.map(x => x.cssText)
.filter(x => x)
.join('\r\n')
*/

for (const key in document.styleSheets) {
    if (document.styleSheets.hasOwnProperty(key)) {
        const element = document.styleSheets[key];
        for (const c in element.cssRules) {
            if (element.cssRules.hasOwnProperty(c)) {
                const rule = element.cssRules[c];
                (window.cssList || (window.cssList = [])).push({ selectorText: rule.selectorText, cssText: rule.cssText });
            }
        }
    }
};
window.cssList2 = {};
window.cssList3 = {};
for(var key in window.cssList){
	if(typeof window.cssList[key].selectorText == "undefined")
	window.cssList3[window.cssList[key].cssText] = true;
	else
	window.cssList2[window.cssList[key].selectorText] =  window.cssList[key].cssText;
}
window.stylesText = "";
for(var key in window.cssList2){if(window.stylesText != ""){window.stylesText += "\r\n"};window.stylesText += window.cssList2[key]}
for(var key in window.cssList3){if(window.stylesText != ""){window.stylesText += "\r\n"};window.stylesText += key}
window.stylesText